package fy.modules.vip
{
	import flash.text.TextFieldAutoSize;
	
	import org.aswing.AbstractListCell;
	import org.aswing.Component;
	import org.aswing.EmptyLayout;
	import org.aswing.JPanel;
	import org.aswing.JTextField;
	//注意要 继承 AbstractListCell
	public class FindVipListCell extends AbstractListCell
	{
		private var container:JPanel;
		private var nameTxt:JTextField;
		private var levelTxt:JTextField;
		public function FindVipListCell()
		{
			super();
			init();
		}
		private function init():void{
			//这里定义 List 的 字段
			container = new JPanel();
			container.setLayout(new EmptyLayout());
			container.setOpaque(true);
			
			nameTxt = new JTextField();
			nameTxt.setSizeWH(80, 22); 
			nameTxt.setLocationXY(45, 0);
			nameTxt.getTextField().autoSize = TextFieldAutoSize.CENTER;
			nameTxt.setEnabled(false);
			
			levelTxt = new JTextField();			
			levelTxt.setSizeWH(24, 22); 
			levelTxt.setLocationXY(130, 0);
			levelTxt.getTextField().autoSize = TextFieldAutoSize.CENTER;
			levelTxt.setEnabled(false);
			
			
			container.appendAll(nameTxt,levelTxt);
		}
		//重写 这个方法   对字段进行赋值
		override public function setCellValue(obj:*):void{
			super.setCellValue(obj);
			
			nameTxt.setHtmlText("");
			levelTxt.setHtmlText("");
		}
		override public function getCellComponent():Component{
			return container;
		}
	}
}